package graph.group.zhangtao.guider.homepage.adapters;

import android.content.Context;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import graph.group.zhangtao.guider.R;

/**
 * Created by lenovo on 2016/7/26.
 */
public class ProfileAdapter extends BaseAdapter {
    Context context;

    public ProfileAdapter(Context context){
        this.context= context;
    }
    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }
    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        if (convertView==null){
            convertView = LayoutInflater.from(context).inflate(R.layout.profile_item,null);
        }
        TextView itemName = (TextView) convertView.findViewById(R.id.tv_pf);
        ImageView profileItemIcon= (ImageView) convertView.findViewById(R.id.iv_pf);
        ImageView deployIcon = (ImageView) convertView.findViewById(R.id.iv_pf_deploy);

        switch (position){
            case 0:
                profileItemIcon.setImageResource(R.drawable.pf_icon_info);
                itemName.setText("个人信息");
                break;
            case 1:
                profileItemIcon.setImageResource(R.drawable.pf_icon_collect);
                itemName.setText("收藏夹");
                break;
            case 2:
                profileItemIcon.setImageResource(R.drawable.pf_icon_history);
                itemName.setText("历史痕迹");
                break;
            case 3:
                profileItemIcon.setImageResource(R.drawable.pf_icon_help);
                itemName.setText("帮助");
                break;
        }
        return convertView;
    }

}
